//StudybarCommentBegin
#include <stdio.h>
#include <malloc.h>
char* encode(char * string);
char* decode(char * string);
void main()
{
	char mingwen[100];
	char miwen[100];
	gets(mingwen);	
	gets(miwen);

	char* jiami=encode(mingwen);
	printf("%s\n",jiami);
	char* jiemi=decode(miwen);
	printf("%s\n",jiemi);
}
//StudybarCommentEnd

char* encode(char * string)
{
	int i=0,j=0;
	static char code[100]={0};
	do
	{
		if(*(string+i)>=97&&*(string+i)<=105)
		{
			switch(*(string+i))
			{
				case 97: code[j]=49;break;
				case 98: code[j]=50;break;
				case 99: code[j]=51;break;
				case 100: code[j]=52;break;
				case 101: code[j]=53;break;
				case 102: code[j]=54;break;
				case 103: code[j]=55;break;
				case 104: code[j]=56;break;
				case 105: code[j]=57;break;
			}		
			i++;
			j++;
		}
		else if(*(string+i)>=106&&*(string+i)<=114)
		{
			code[j]=48;
			j++;
			switch(*(string+i))
			{
				case 106: code[j]=49;break;
				case 107: code[j]=50;break;
				case 108: code[j]=51;break;
				case 109: code[j]=52;break;
				case 110: code[j]=53;break;
				case 111: code[j]=54;break;
				case 112: code[j]=55;break;
				case 113: code[j]=56;break;
				case 114: code[j]=57;break;
			}
			i++;
			j++;
		}
		else if(*(string+i)>=115&&*(string+i)<=122)
		{
			code[j]=48;
			j++;
			code[j]=48;
			j++;
			switch(*(string+i))
			{
				case 115: code[j]=49;break;
				case 116: code[j]=50;break;
				case 117: code[j]=51;break;
				case 118: code[j]=52;break;
				case 119: code[j]=53;break;
				case 120: code[j]=54;break;
				case 121: code[j]=55;break;
				case 122: code[j]=56;break;
			}
			i++;
			j++;								
		}
		else 
		{
			code[j]=*(string+i);
			i++;
			j++;
		}
	}while(*(string+i)!=0);
	
	return code;	
}

char* decode(char * string)
{
	static char acode[100];
	int i=0,j=0;
	do
	{		
		 
		if(*(string+i)==48)
		{
			i++;
			if(*(string+i)==48)
			{
				i++;
				switch(*(string+i)) 
				{
					case 49: acode[j]=115;break;
					case 50: acode[j]=116;break;
					case 51: acode[j]=117;break;
					case 52: acode[j]=118;break;
					case 53: acode[j]=119;break;
					case 54: acode[j]=120;break;
					case 55: acode[j]=121;break;
					case 56: acode[j]=122;break;
				}	 
				j++;
				i++;
				continue;
			}
			switch(*(string+i)) 
			{
				case 49: acode[j]=106;break;
				case 50: acode[j]=107;break;
				case 51: acode[j]=108;break;
				case 52: acode[j]=109;break;
				case 53: acode[j]=110;break;
				case 54: acode[j]=111;break;
				case 55: acode[j]=112;break;
				case 56: acode[j]=113;break;
				case 57: acode[j]=114;break;
			}	 
			j++;
			i++;
			continue;
		}
		switch(*(string+i)) 
		{
			case 49: acode[j]=97;break;
			case 50: acode[j]=98;break;
			case 51: acode[j]=99;break;
			case 52: acode[j]=100;break;
			case 53: acode[j]=101;break;
			case 54: acode[j]=102;break;
			case 55: acode[j]=103;break;
			case 56: acode[j]=104;break;
			case 57: acode[j]=105;break;
			default: acode[j]=*(string+i);
		}	 
		j++;
		i++;		
	}while(*(string+i)!=0);
	return acode;
}
